﻿{% extends "base.html" %}

{% block title %}Сообщение {{ message.subject }}{% endblock %}

{% block includes %}

{% endblock %}

{% block header %}Сообщение от {{ message._from }}{% endblock %}

{% block content %}

	<p>От кого: <a href="{{ 'userprofile.views.view_profile'|url(id=message.sender.id|int) }}">{{ message.sender }}</a></p>
	{% if message.subject != '' %}<p>{{ message.subject }}</p>{% endif %}
	<p>{{ message.text }}</p>
	<small>{{ message.date }}</small>
	<form action="{{ 'communication.views.post_message'|url }}" method="POST">
	<table>
		{% for field in message_form.visible_fields() %}
				<tr>
					<th>
					<label for="{{ field.name }}">
						{{ field.label_tag() }}
					</label>
					</th>
					<td>
					{{ field }}
					{% if field.errors %}
						<div class="errors">{{ field.errors }}</div>
					{% endif %}
					</td>
				</tr>
		{% endfor %}
	       {% for hidden in message_form.hidden_fields() %}
	       	{{ hidden }}
	       {% endfor %}
	       </table>
	   <input type="submit" value="Yarrr!">
	</table>
	</form>
{% endblock %}
